<?php
/**
 * Created by PhpStorm.
 * User: liyu
 * Date: 2018/4/9
 * Time: 上午10:22
 */

namespace app\common\exception;


class Base extends \Exception
{
    protected static $instance;

    protected $errorCode = 10000;

    protected $msg = '参数错误';

    public static function instance()
    {
        if (empty(self::$instance))
            self::$instance = new self;
        return self::$instance;
    }

    public function setErrorCode($code)
    {
        return $this->errorCode = $code;
    }

    public function setMsg($msg)
    {
        return $this->msg = $msg;
    }

    public function getErrorCode()
    {
        return $this->errorCode;
    }

    public function getMsg()
    {
        return $this->msg;
    }
}